﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Sim
{
    public partial class Sim : Form
    {
        public Sim()
        {
            InitializeComponent();
        }

        private void OpenFile(object sender, EventArgs e)
        {



        }

        private void SelectApp(object sender, EventArgs e)
        {
            OpenFileDialog open  = new OpenFileDialog();

            open.InitialDirectory = "D:\\Everything\\Process\\git\\sptv012\\SptV012\\SptSim\\Debug";
            open.Filter = "动态库|*.dll";
            open.FilterIndex = 1;
            open.RestoreDirectory = true;
            if (open.ShowDialog()!= DialogResult.OK)
            {
                return;
            }
            LoadApp.Select(open.FileName);
            

        }

        private void RunApp(object sender, EventArgs e)
        {
            LoadApp.SptInfo = SptInfo;
            if (Program.SslApp == null)
            {
                LoadApp.Run();
            }
            else if (Program.SslApp.Started)
            {
                Program.SslApp.Resume();
            }
        }

        private void Sim_Load(object sender, EventArgs e)
        {
            Program.DbgInfo = totalInfo.AppendText;
            Program.DbgInfo += SimInfo.AppendText;
            Program.DbgInfo("SimLoad");
        }

        private void Suspend(object sender, EventArgs e)
        {
            Program.SslApp?.Suspend();
        }

        private void Stop(object sender, EventArgs e)
        {
            LoadApp.Unload();
        }

        private void UnLoad(object sender, FormClosedEventArgs e)
        {
            Stop(sender,e);
        }

        private void splitContainer2_SplitterMoved(object sender, SplitterEventArgs e)
        {

        }

        private void textBox1_TextChanged(object sender, EventArgs e)
        {

        }

        private void splitContainer1_Panel2_Paint(object sender, PaintEventArgs e)
        {

        }

        private void textBox1_TextChanged_1(object sender, EventArgs e)
        {

        }
    }

}
